package com.qst.mapreduce.wordcount.mywc;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;


public class CustomPartitioner extends Partitioner<Text, IntWritable> {
    @Override
    public int getPartition(Text key, IntWritable value, int i) {
        if (key.toString().equals("a")){
            return 0;
        } else if (key.toString().equals("b")) {
            return 1;
        }
        else {
            return 2;
        }
    }
}
